<?php

namespace App\Http\Requests\Register;

use App\Http\Requests\Request;

class RegisterMemberRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        // 注册账号不要求是已登录状态，直接返回 true
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            // 注册基本信息
            'user' => 'required|unique:members|between:4,50',
            'password' => 'required|confirmed',
            'email' => 'required|email|unique:members',

            // 验证码
           // 'captcha' => 'required|captcha',
        ];
    }
}
